]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Use Shell.get_file_contents_utf8_sync over GLib.file_get_contents
authorColin Walters <walters@verbum.org>
Wed, 11 May 2011 18:19:24 +0000 (14:19 -0400)
committerColin Walters <walters@verbum.org>
Thu, 19 May 2011 19:27:23 +0000 (15:27 -0400)
We need to fix the latter to return a byte array, which gjs doesn't
deal with well right now.

https://bugzilla.gnome.org/show_bug.cgi?id=649981

js/ui/placeDisplay.js
js/ui/windowManager.js

index 59ca4a6db6c77fe30c25724a9bf511d4ddebaa2a..93542476d2ef18b16ef5bfb029bb9fd54747ffc0 100644 (file)
@@ -268,10 +268,7 @@ PlacesManager.prototype = {
         if (!GLib.file_test(this._bookmarksPath, GLib.FileTest.EXISTS))
             return;
 
-        let [success, bookmarksContent, len] = GLib.file_get_contents(this._bookmarksPath);
-
-        if (!success)
-            return;
+        let bookmarksContent = Shell.get_file_contents_utf8_sync(this._bookmarksPath);
 
         let bookmarks = bookmarksContent.split('\n');
 
index b113a1a2834f84d313bdfb66029203d10b77acf8..52a00daa958fc59d9db46413150e0deb5c8a7d8c 100644 (file)
@@ -22,8 +22,7 @@ function getDimShader() {
     if (dimShader === null)
         return null;
     if (!dimShader) {
-        let [success, source, length] = GLib.file_get_contents(global.datadir +
-                                                               '/shaders/dim-window.glsl');
+        let source = Shell.get_file_contents_utf8_sync(global.datadir + '/shaders/dim-window.glsl');
         try {
             let shader = new Clutter.Shader();
             shader.set_fragment_source(source, -1);